<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <script>
    var room = { //目标对象
      name: "小王",
      phone: "18888888888",
      room: 180,
      price: 150
    }
    var p = new Proxy(room, {
      get() { },
      set() { //阻止对 对象的修改
        return false
      }
    })
    // room.price = 800;//用了代理以后不操作源对象
    // console.log(room)
    p.price = 800;
    console.log(p)
  </script>
</body>

</html>